-
Notifications
You must be signed in to change notification settings - Fork 551
Model Observer #3695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Model Observer #3695
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3695 +/- ##
==========================================
- Coverage 89.20% 89.17% -0.04%
==========================================
Files 892 894 +2
Lines 103018 103546 +528
==========================================
+ Hits 91894 92332 +438
- Misses 11124 11214 +90
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
obs.add_parameters(params) | ||
|
||
def _check_for_new_vars(self, variables: List[VarData]): | ||
new_vars = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't enough to make new_vars a list and append non referenced variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think also this pattern is repeated multiple times.
from pyomo.contrib.observer.model_observer import ( | ||
Observer, | ||
ModelChangeDetector, | ||
AutoUpdateConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There aren't actually any tests that exercise AutoUpdateConfig
. There also isn't any documentation that shows how to use it. Can you add a test (that can act as documentation)?
Summary/Motivation:
This PR extracts the code for detecting changes in models from the persistent solver interfaces to its own, independent functionality. I will have a separate PR shortly that removes the code from the solver interfaces and updates them to use this code.
Changes proposed in this PR:
observer
that can be used to inform other classes of what changed in a pyomo model.Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: